package com.remote.ui;

import com.remote.client.ClientCommandContext;
import com.remote.client.RemoteClient;
import com.remote.client.RemoteClientConfiguration;
import com.remote.common.command.handler.CommandContext;
import com.remote.common.context.RemoteContext;
import com.remote.ui.component.DPIComponent;
import com.remote.ui.component.ScreenComponent;
import com.remote.ui.constant.UIConstant;
import com.remote.ui.core.ControllerManager;
import com.remote.ui.core.manager.AppControllerManager;
import javafx.application.Application;
import javafx.stage.Stage;

public class Main extends Application {

    @Override
    public void start(Stage primaryStage) throws Exception {
        RemoteClientConfiguration clientConfiguration = new RemoteClientConfiguration();
        clientConfiguration.setHost("192.168.2.105");
        clientConfiguration.setPort(9000);
        RemoteContext remoteContext = new RemoteClient(clientConfiguration);
        CommandContext interactiveHandle = new ClientCommandContext(remoteContext);
        ControllerManager uiManager = new AppControllerManager(interactiveHandle);
        uiManager.addComponent(new ScreenComponent());
        uiManager.addComponent(new DPIComponent());
        uiManager.getStarter(UIConstant.UI_SCREEN);
        uiManager.getStarter(UIConstant.UI_HOME).setStage(primaryStage).show("远程桌面");
    }


    public static void main(String[] args) {
        launch(args);
    }


}
